oxenstored: avoid leading slash in paths in saved store state
authorJonathan Davies <jonathan.davies@citrix.com>
Fri, 7 Apr 2017 13:27:19 +0000 (14:27 +0100)
committerWei Liu <wei.liu2@citrix.com>
Mon, 10 Apr 2017 13:46:21 +0000 (14:46 +0100)
commit506114e9183de1640f3c2e5b66f4980b596164f7
tree0c275cc01f98dfb9771371a8cae96b1a24b690dd
parent0c7b704097409cc6500284c51fada0b4f3a695eb
oxenstored: avoid leading slash in paths in saved store state

Internally, paths are represented as lists of strings, where
  * path "/" is represented by []
  * path "/local/domain/0" is represented by ["local"; "domain"; "0"]
(see comment for Store.Path.t).

However, the traversal function generated paths like
    [""; "local"; "domain"; "0"]
because the name of the root node is "". Change it to generate paths
correctly.

Furthermore, the function passed to Store.dump_fct would render the node
"foo" under the path [] as "//foo". Change this to return "/foo".

Signed-off-by: Jonathan Davies <jonathan.davies@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Christian Lindig <christian.lindig@citrix.com>
Release-acked-by: Julien Grall <julien.grall@arm.com>
tools/ocaml/xenstored/store.ml
tools/ocaml/xenstored/xenstored.ml